/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PantallaAdministrador.java
 *
 * Created on May 9, 2010, 1:12:55 AM
 */

package gui;

import java.awt.CardLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import utilidades.Pantalla;

/**
 *
 * @author Snailin
 */
public class PantallaAdministrador extends javax.swing.JFrame {

    private Pantalla pantallaCompleta=null;
    private CardLayout cardLayout=null;
    private PanelFachada panelFachada=null;
    private PanelOpcionesIngeniero panelOpcionesIngeniero=null;
    private PanelOpcionesInstitucion panelOpcionesInstitucion=null;
    private PanelOpcionesSupervisor panelOpcionesSupervisor;
    private PanelOpcionesCentro panelOpcionesCentro;
    /** Creates new form PantallaAdministrador */
    public PantallaAdministrador() {
        getPanelFachada();
        getPanelOpcionesIngeniero();
        getPanelOpcionesInstitucion();
        initComponents();

        cardLayout=new CardLayout();
        this.setTitle("Sistema De Gestion De Proyectos Indotel");
        this.pantallaCompleta=Pantalla.getInstancia();
        panelDinamico.setLayout(cardLayout);
        cardLayout.show(panelDinamico, "fachada");
        panelDinamico.add("fachada", getPanelFachada());
        panelDinamico.add("Supervisor",getPanelOpcionesSupervisor());
        panelDinamico.add("Ingeniero",getPanelOpcionesIngeniero());
        panelDinamico.add("Institucion",getPanelOpcionesInstitucion());
        panelDinamico.add("Centro",getPanelOpcionesCentro());
      



        pantallaCompleta.setFullScreen(this);
           			lblIngeniero.addMouseListener(new java.awt.event.MouseAdapter() {
				@Override
				public void mouseClicked(java.awt.event.MouseEvent e) {
					cardLayout.show(panelDinamico, "Ingeniero");
				}

				@Override
				public void mouseExited(java.awt.event.MouseEvent e) {
					lblIngeniero.setBorder(null);
				}

				@Override
				public void mouseEntered(java.awt.event.MouseEvent e) {
					lblIngeniero.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.RAISED));
				}

				@Override
				public void mousePressed(java.awt.event.MouseEvent e) {
					lblIngeniero.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.LOWERED));
				}
			});

    
        			lblInstitucion.addMouseListener(new java.awt.event.MouseAdapter() {
				@Override
				public void mouseClicked(java.awt.event.MouseEvent e) {
					cardLayout.show(panelDinamico, "Institucion");
				}

				@Override
				public void mouseExited(java.awt.event.MouseEvent e) {
					lblInstitucion.setBorder(null);
				}

				@Override
				public void mouseEntered(java.awt.event.MouseEvent e) {
					lblInstitucion.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.RAISED));
				}

				@Override
				public void mousePressed(java.awt.event.MouseEvent e) {
					lblInstitucion.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.LOWERED));
				}
			});


                        lblCentro.addMouseListener(new java.awt.event.MouseAdapter() {
				@Override
				public void mouseClicked(java.awt.event.MouseEvent e) {
					cardLayout.show(panelDinamico, "Centro");
				}

				@Override
				public void mouseExited(java.awt.event.MouseEvent e) {
					lblCentro.setBorder(null);
				}

				@Override
				public void mouseEntered(java.awt.event.MouseEvent e) {
					lblCentro.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.RAISED));
				}

				@Override
				public void mousePressed(java.awt.event.MouseEvent e) {
					lblCentro.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.LOWERED));
				}
			});

                        lblSupervision.addMouseListener(new java.awt.event.MouseAdapter() {
				@Override
				public void mouseClicked(java.awt.event.MouseEvent e) {
					cardLayout.show(panelDinamico, "Supervisor");
				}

				@Override
				public void mouseExited(java.awt.event.MouseEvent e) {
					lblSupervision.setBorder(null);
				}

				@Override
				public void mouseEntered(java.awt.event.MouseEvent e) {
					lblSupervision.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.RAISED));
				}

				@Override
				public void mousePressed(java.awt.event.MouseEvent e) {
					lblSupervision.setBorder(BorderFactory
							.createBevelBorder(BevelBorder.LOWERED));
				}
			});
    
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BarraOpciones = new javax.swing.JToolBar();
        lblIngeniero = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        lblInstitucion = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        lblSupervision = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JToolBar.Separator();
        lblCentro = new javax.swing.JLabel();
        panelDinamico = new javax.swing.JPanel();
        barraMenu = new javax.swing.JMenuBar();
        menuArchivo = new javax.swing.JMenu();
        menuHerramienta = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        BarraOpciones.setRollover(true);

        lblIngeniero.setText("Ingeniero");
        BarraOpciones.add(lblIngeniero);
        BarraOpciones.add(jSeparator1);

        lblInstitucion.setText("Intitucion");
        BarraOpciones.add(lblInstitucion);
        BarraOpciones.add(jSeparator2);

        lblSupervision.setText("Supervisor");
        BarraOpciones.add(lblSupervision);
        BarraOpciones.add(jSeparator3);

        lblCentro.setText("Centro");
        BarraOpciones.add(lblCentro);

        panelDinamico.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout panelDinamicoLayout = new javax.swing.GroupLayout(panelDinamico);
        panelDinamico.setLayout(panelDinamicoLayout);
        panelDinamicoLayout.setHorizontalGroup(
            panelDinamicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1059, Short.MAX_VALUE)
        );
        panelDinamicoLayout.setVerticalGroup(
            panelDinamicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 479, Short.MAX_VALUE)
        );

        menuArchivo.setText("Archivo");
        barraMenu.add(menuArchivo);

        menuHerramienta.setText("Herramientas");
        barraMenu.add(menuHerramienta);

        setJMenuBar(barraMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BarraOpciones, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1061, Short.MAX_VALUE)
            .addComponent(panelDinamico, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BarraOpciones, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(panelDinamico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PantallaAdministrador().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JToolBar BarraOpciones;
    private javax.swing.JMenuBar barraMenu;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar.Separator jSeparator3;
    private javax.swing.JLabel lblCentro;
    private javax.swing.JLabel lblIngeniero;
    private javax.swing.JLabel lblInstitucion;
    private javax.swing.JLabel lblSupervision;
    private javax.swing.JMenu menuArchivo;
    private javax.swing.JMenu menuHerramienta;
    private javax.swing.JPanel panelDinamico;
    // End of variables declaration//GEN-END:variables



    public JPanel getPanelFachada(){
        if(panelFachada==null){
            panelFachada=new PanelFachada();
        }
    return panelFachada;
    }

    public JPanel getPanelOpcionesIngeniero(){

        if(panelOpcionesIngeniero==null){
            panelOpcionesIngeniero=new PanelOpcionesIngeniero();
        }
    return panelOpcionesIngeniero;
    }

    public JPanel getPanelOpcionesSupervisor(){

        if(panelOpcionesSupervisor==null){
            panelOpcionesSupervisor=new PanelOpcionesSupervisor();
        }
    return panelOpcionesSupervisor;
    }

     public JPanel getPanelOpcionesCentro(){

        if(panelOpcionesCentro==null){
            panelOpcionesCentro=new PanelOpcionesCentro();
        }
    return panelOpcionesCentro;
    }


       public JPanel getPanelOpcionesInstitucion(){

        if(panelOpcionesInstitucion==null){
            panelOpcionesInstitucion=new PanelOpcionesInstitucion();
        }
            return panelOpcionesInstitucion;
    }
}
